﻿using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;

namespace Pointandclick.Objects
{
    class Clickable: MouseInteractive
    {
        bool clicked = false;

        public Clickable(Texture2D image, Point position)
            : base(image, position)
        {
        }

        /// <summary>
        /// Checks if the object is clicked for the first time
        /// </summary>
        /// <param name="mouse"></param>
        /// <param name="gameTime"></param>
        /// <returns></returns>
        public bool Update()
        {
            //The click is only returned if the object has not been clicked yet
            if (ClickedOn() && !clicked)
            {
                clicked = true;
                return true;
            }
            return false;
        }
    }
}
